package com.kmproject.haifu.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.http.imageloader.glide.ImageConfigImpl;
import com.jess.arms.utils.ArmsUtils;
import com.kmproject.haifu.R;
import com.kmproject.haifu.mvp.model.entity.beans.MemberFeatureBean;

import java.util.List;

public class MemberUpdateLevelFeatureAdapter extends BaseQuickAdapter<MemberFeatureBean, BaseViewHolder> {
    ImageLoader mglideImage;
    public MemberUpdateLevelFeatureAdapter(@Nullable List<MemberFeatureBean> data) {
        super(R.layout.member_center_update_level_item1,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MemberFeatureBean item) {

        if (mglideImage == null) {
            mglideImage = ArmsUtils.obtainAppComponentFromContext(mContext).imageLoader();
        }
        mglideImage.loadImage(mContext, ImageConfigImpl.builder().url(item.getImage()).isCenterCrop(true)
                .imageView(helper.<ImageView>getView(R.id.member_center_update_level_item1))
                .build());
        helper.<TextView>getView(R.id.member_center_update_level_item1_tv1).setText(item.getFunctionNameMember());
        helper.<TextView>getView(R.id.member_center_update_level_item1_tv2).setText(item.getDescriptionMember());
//        if (helper.getPosition()==getData().size())
//        {
//            helper.getView(R.id.member_center_update_level_item1_line).setVisibility(View.GONE);
//        }
    }
}
